const express = require('express');
const multer = require('multer')
const upload = multer({ dest: 'public/productuploads/' })

const productRouter = express.Router();
const ProductController = require('../../controllers/admin/ProductController')

productRouter.post('/adminapi/product/add', upload.single('file'), ProductController.add)

productRouter.get('/adminapi/product/list/:id', ProductController.getList)

productRouter.delete('/adminapi/product/delete/:id', ProductController.delete)

productRouter.post('/adminapi/product/edit', upload.single('file'), ProductController.edit)

module.exports = productRouter;
